<?php
		require_once "funciones.php";
		$link_caweb = con_caweb();

		$q=$_POST["q"];
		$link_caweb = con_caweb();
		
		$result ="SELECT * FROM taxonomia WHERE clase='$q' GROUP BY codigosubclase";
  		$result=mysql_query($result,$link_caweb) or die('Error taxonomia, '.mysql_error());
		
		echo "Subclase: <select name='subclase' size='1' id='subclase' onchange='
		    $(\"#layer10_familias_cambio\").load(\"layer10_familias_cambio.php\",{q:this.value});
		    document.getElementById(\"codigotax\").value=this.value;
		    top.document.Form1.campo3.value=this.value;
			'>";
			
		echo "<option value='XXX' SELECTED>Seleccionar..</option>";
        while($row = mysql_fetch_array($result))
        {
        	echo "<option value=".$row[codigosubclase].">".$row[descripcionsub]."</option>";
        }
        echo "</select>";
?>